<template>
	<view style="width: 100%;padding: 40rpx;padding-top: 0rpx;padding-bottom: 20rpx;" v-if="formItems.length!=0" :class="class_bg" 
	:style="{ 
		marginTop: marginTop,
		borderTopRightRadius:borderTopRightRadius,
		borderTopLeftRadius:borderTopLeftRadius,
		borderBottomRightRadius:borderBottomRightRadius,
		borderBottomLeftRadius:borderBottomLeftRadius
	}" 
	>
		<u-form ref="uForm" :model="formData" label-width="200" label-position="top">
			<template v-for="(item, index) in formItems" v-if="item.show !== false">
				<!-- {{item}} -->
				
				<!--disabled   此处输入框不可选不可修改-->
				<template v-if="item.type === 'disabled'">
					<view v-show="item.key!='price_unit'">
						<!-- {{item.label}}-{{item.key}}-{{item}} -->
						<u-form-item :key="index" :label="$t(item.label)" :required="item.required">
							<u-input :placeholder="$t(item.placeholder)" :placeholder-style="placeholderStyle"
								:value="item.key != 'num' ? $t(item.value) : item.value" disabled />
							<!-- 
								item.key != 'num' ? $t(item.value) : item.value 
								这个判断是因为有的value是1 ，这样就会翻译成否 
							-->
							<template v-slot:right>
								<template v-if="item.slotDisabledText">
									<text style="margin-right: 10rpx;color: #000;">{{$t(item.slotDisabledText)}}</text>
								</template>
								<template v-if="item.explain">
									<u-button type="warning" size="mini" @click="clickIcon(item)">{{$t("释义")}}</u-button>
								</template>
							</template>
						</u-form-item>
					</view>		
				</template>
				
				<!--此处为参与竞标 保证金的验证， 当发布者 选择缴纳保证金 ， 竞标者 显示 保证金金额 并不可选， 否则 保证金金额输入框  隐藏-->
				<template v-if="item.type === 'disableds'">
					
					<u-form-item :key="index" :label="$t(item.label)" :required="item.required" v-if="is_margin_show==2">
						<u-input :placeholder="$t(item.placeholder)" :placeholder-style="placeholderStyle"
							:value="item.key != 'num' ? $t(item.value) : item.value" disabled />			
						<template v-slot:right>
							<template v-if="item.slotDisabledText">
								<text style="margin-right: 10rpx;color: #000;">{{$t(item.slotDisabledText)}}</text>
							</template>
							<template v-if="item.explain">
								<u-button type="warning" size="mini" @click="clickIcon(item)">{{$t("释义")}}</u-button>
							</template>
						</template>
					</u-form-item>
					<u-form-item :key="index" :label="$t(item.label)" :required="item.required" v-else>
						<block v-if="item.rule&&item.rule.edit==false">
							<u-input :placeholder="$t(item.placeholder)" :placeholder-style="placeholderStyle" disabled
								:value="item.key != 'num' ? $t(item.value) : item.value" @input="checkAmount"/>
								 <view  v-if="errorMessage">{{ errorMessage }}</view>
						</block>
						<block v-else>
							<u-input :placeholder="$t(item.placeholder)" :placeholder-style="placeholderStyle"
								:value="item.key != 'num' ? $t(item.value) : item.value" @input="checkAmount"/>
								 <view  v-if="errorMessage">{{ errorMessage }}</view>
						</block>

						<template v-slot:right>
							<template v-if="item.slotDisabledText">
								<text style="margin-right: 10rpx;color: #000;">{{$t(item.slotDisabledText)}}</text>
							</template>
							<template v-if="item.explain">
								<u-button  type="warning" size="mini" @click="clickIcon(item)">{{$t("释义")}}</u-button>
							</template>
						</template>
					</u-form-item>
					
				</template>

				<!--text :adjustPosition='false'-->
				<template v-if="item.type === 'text'">
					<u-form-item :key="index" :label="$t(item.label)" :label-style="labelStyle"
						:required="item.required">
						<block v-if="isDetail2==1">
							<u-input v-model="formData[item.key]" :placeholder="$t(item.placeholder)"
								:placeholder-style="placeholderStyle" :value="item.value ? item.value : ''"  disabled  />
						</block>
						<block v-if="isDetail2==0">
							<u-input v-model="formData[item.key]" :placeholder="$t(item.placeholder)"
								:placeholder-style="placeholderStyle" :value="item.value ? item.value : ''"    />
						</block>
						<template slot="right" v-if="item.explain">
							<u-button type="warning" size="mini" @click="clickIcon(item)">{{$t("释义")}}</u-button>
						</template>
					</u-form-item>
				</template>

				<!--number 数字-->
				<template v-if="item.type === 'number'">
					
					<block v-if="item.key=='express_speed'&&is_express_price==1"></block>
					<block v-else>
						<u-form-item :key="index" :label="$t(item.label)" :label-style="labelStyle"
							:required="item.required">
							<block v-if="isDetail2==1">
								<u-input v-model="formData[item.key]" type="digit" :placeholder="$t(item.placeholder)"
								:placeholder-style="placeholderStyle" :value="item.value ? item.value : ''"  disabled />
							</block>
							<block v-if="isDetail2==0">	
								<u-input v-model="formData[item.key]" type="digit" :placeholder="$t(item.placeholder)"
								:placeholder-style="placeholderStyle" :value="item.value ? item.value : ''" />
							</block>
								
								
							<!-- 如果是期望单价 后面追加  价格单位 / 数量单位 -->
							<template slot="right">
								<!-- 如果是数量后面跟数量单位 -->
								<!-- 2024年4月20日 20:21:02 配置项如果需要添加后缀，需要加 slot 属性  -->
								<!-- {{formData}} -->
								<template v-if="item.slot">
									{{$t(formData[item.slot])}}
									<template v-if="item.slot1 && lang == 'zh'">
										{{' / '+ formData[item.slot1]}}
									</template>
									<template v-if="item.slot1_ru && lang == 'ru'">
										{{' / '+ formData[item.slot1_ru]}}
									</template>
									<template v-if="item.slottext">
										{{' / '+ item.slottext}}
									</template>
									<template v-if="item.explain">
										<!-- <u-icon name="question-circle" @click="clickIcon(item)"></u-icon> -->
										<u-button type="warning" size="mini"
											@click="clickIcon(item)">{{$t("释义")}}</u-button>
									</template>
								</template>
								<template v-else-if="item.key === 'desire_price' || item.key === 'price'">
									{{$t(formData["price_unit"])}}
									<!-- <template v-if="formData[$t('item.number_unit')]">
										{{' / '+formData[$t('item.number_unit')]}}
									</template> -->
									<template v-if="item.explain">
										<!-- <u-icon name="question-circle" @click="clickIcon(item)"></u-icon> -->
										<u-button type="warning" size="mini"
											@click="clickIcon(item)">{{$t("释义")}}</u-button>
									</template>
								</template>
								<!-- 如果是数量后面跟数量单位 -->
								<template v-else-if="item.key === 'num'">
									{{formData["number_unit"]}}
									<template v-if="item.explain">
										<!-- <u-icon name="question-circle" @click="clickIcon(item)"></u-icon> -->
										<u-button type="warning" size="mini"
											@click="clickIcon(item)">{{$t("释义")}}</u-button>
									</template>
								</template>
								
							</template>
						</u-form-item>
					</block>
				</template>

				<!--actionSheet-->
				<template v-if="item.type === 'actionSheet'">
					<actionSheet :item="item" @change="selActionSheet" />
				</template>
				
				<template v-if="item.type === 'actionSheet2'">
					<actionSheet :item="item" @change="selActionSheet2" />
				</template>

				<!--checkbox-->
				<template v-if="item.type === 'checkbox'">
					<formCheckBox :item="item" @change="selCheckbox" />
				</template>

				<!--radio-->
				<template v-if="item.type === 'radio'">
					<block v-if="item.key=='is_margin'&&formData['order_is_margin']==1">
						
					</block>	<!--查看订单详情时-->
					<block v-else-if="item.key=='number_unit'">
						
						 <formRadio :item="item" @change="selRadio1" :postunit="postunit" :hwjbfb="hwjbfb"/>								<!--发布时-->
					</block>
					<block v-else-if="item.key=='price_unit'">
						
						<formRadio :item="item" @change="selRadio" :postunit="postunit"/>								<!--发布时-->
					</block>
					<block v-else>
						
						<formRadio :item="item" @change="selRadio" :postunit="postunit" :hwjbfb="hwjbfb"/>								<!--发布时-->
					</block>
				</template>
				
				<template v-if="item.type === 'radios'">
					
					<formRadio :item="item" @change="selRadio" v-show="item.key=='is_margin'&&item.value=='2'" :postunit="postunit"/>	<!--参与竞标时-->
				</template>
				
				
				<!--textarea-->
				<template v-if="item.type === 'textarea'">
					<block v-if="(item.rules&&item.rules.border)">		
						<u-form-item :key="index" :label="$t(item.label)" :required="item.required" :borderBottom="false">				
						<block v-if="isDetail2==1">
							<u-input v-model="formData[item.key]" :placeholder="$t(item.placeholder)"
							:value="item.value ? item.value : ''" :custom-style="textareaStyle2" height="200"
							type="textarea" maxlength="1500"  disabled  />
						</block>
						<block v-if="isDetail2==0">
							<u-input v-model="formData[item.key]" :placeholder="$t(item.placeholder)"
							:value="item.value ? item.value : ''" :custom-style="textareaStyle2" height="200"
							type="textarea" maxlength="1500" />
						</block>
						</u-form-item>
					</block>
					<block v-else>
						<u-form-item :key="index" :label="$t(item.label)" :required="item.required" >
							<block v-if="isDetail2==1">
								<u-input v-model="formData[item.key]" :placeholder="$t(item.placeholder)"
									:value="item.value ? item.value : ''" :custom-style="textareaStyle" height="400"
									type="textarea" maxlength="1500"  disabled />							
							</block>
							<block v-if="isDetail2==0">
								<u-input style="border: 1rpx solid #CED9E2;border-radius:16rpx;padding:20rpx;box-sizing: border-box;" v-model="formData[item.key]" :placeholder="$t(item.placeholder)"
										:value="item.value ? item.value : ''" :custom-style="textareaStyle" height="200"
										type="textarea" maxlength="1500" />							
							</block>
						</u-form-item>	
					</block>
				</template>

				<!--images-->
				<template v-if="item.type === 'images'">
					<block v-if="isDetail2==1">
						<view>
							<view v-if="item.value&&item.value.length!=0" style="margin-top: 20rpx;margin-bottom: 10rpx;font-weight: bold;">{{$t(item.label.replace(/['上传']/gi, "").replace(/['请']/gi, ""))}}</view>
							<image v-if="item.value&&item.value.length!=0" :src="vv.url" v-for="(vv,ind) in item.value" :key="ind" style="width: 60px;height: 60px;"></image>
						</view>
					</block>
					<block v-if="isDetail2==0">
						<formImages :item="item" @change="selImages" />
					</block>
				</template>

				<!--files-->
				<template v-if="item.type === 'files'">
					<block v-if="isDetail2==1">
						<view>
							<view v-if="item.value&&item.value.length!=0" style="margin-top: 20rpx;margin-bottom: 10rpx;font-weight: bold;">{{$t(item.label.replace(/['上传']/gi, "").replace(/['请']/gi, ""))}}</view>
							<text v-if="item.value&&item.value.length!=0" v-for="(vv,ind) in item.value" :key="ind">{{vv.url.substring(vv.url.length, vv.url.length - 20)}}</text>
						</view>
					</block>
					<block v-if="isDetail2==0">
						<formFiles :item="item" @change="selFiles" />
					</block>
				</template>
				
				

				<!--videos-->
				<template v-if="item.type === 'videos'">
					<block v-if="isDetail2==1">
						<view>
							<view v-if="item.value&&item.value.length!=0" style="margin-top: 20rpx;margin-bottom: 10rpx;font-weight: bold;">{{$t(item.label.replace(/['上传']/gi, "").replace(/['请']/gi, ""))}}</view>
							<text v-if="item.value&&item.value.length!=0" v-for="(vv,ind) in item.value" :key="ind">{{vv.url.substring(vv.url.length, vv.url.length - 20)}}</text>
						</view>
					</block>
					<block v-if="isDetail2==0">
						<formVideos :item="item" @change="selVideos" />
					</block>
				</template>
				
				<template v-if="item.type === 'filelist'">
					<block v-if="isDetail2==1">
						<view>
							<view v-if="item.value&&item.value.length!=0" style="margin-top: 20rpx;margin-bottom: 10rpx;font-weight: bold;">{{$t(item.label.replace(/['上传']/gi, "").replace(/['请']/gi, ""))}}</view>
							<text v-if="item.value&&item.value.length!=0" v-for="(vv,ind) in item.value" :key="ind">{{vv.url.substring(vv.url.length, vv.url.length - 20)}}</text>
						</view>
					</block>
					<block v-if="isDetail2==0">
						<formFiles :item="item" @change="selFiles2" :flag="2" />
					</block>
				</template>

				<!--city-->
				<template v-if="item.type === 'city'">
					<formCity :item="item" @change="selCity" :select_city_new="select_city_new"  />
				</template>
				
				<template v-if="item.type === 'city2'">
					<formCity2 :item="item" @change="selCity" :select_city_newd="select_city_newd"  />
				</template>

				<!--通关口岸-->
				<template v-if="item.type === 'port_city'">
					<formPortCity :item="item" @change="selCity" />
				</template>

				<!--digit-->
				<template v-if="item.type === 'digit'">
					<block v-if="item.key=='margin_price'||item.key=='margin_amount'">
						<u-form-item v-if="is_margin_show==2" :key="index" :label="$t(item.label)" :required="item.required">
							<u-input v-model="formData[item.key]" :placeholder="$t(item.placeholder)"
								:value="item.value ? item.value : ''" type="digit" />
							<template slot="right">
								<!-- <u-icon name="question-circle" @click="clickIcon(item)"></u-icon> -->
								<span style="margin-right: 10rpx;">{{$t('元')}}</span>
								<!-- <u-button v-if="item.explain" type="warning" size="mini"
									@click="clickIcon(item)">{{$t("释义")}}</u-button> -->
							</template>
							
						</u-form-item>
					</block>
					<block v-else>
						<u-form-item :key="index" :label="$t(item.label)" :required="item.required">
							<u-input v-model="formData[item.key]" :placeholder="$t(item.placeholder)"
								:value="item.value ? item.value : ''" type="digit" />
							<template slot="right">
								<!-- <u-icon name="question-circle" @click="clickIcon(item)"></u-icon> -->
								<span style="margin-right: 10rpx;">{{$t('元')}}</span>
								<!-- <u-button v-if="item.explain" type="warning" size="mini"
									@click="clickIcon(item)">{{$t("释义")}}</u-button> -->
							</template>
						</u-form-item>
					</block>
				</template>

				<!--manyInput一行多个input-->
				<template v-if="item.type === 'manyInput'">
					<u-form-item :key="index" :label="$t(item.label)" :label-style="labelStyle"
						:required="item.required">
						<view style="display: flex;flex-wrap: nowrap">
							<block v-if="isDetail2==1">
								<u-input v-for="(inputItem, inputIndex) in item.key" type="digit" :key="inputIndex"
								v-model="formData[inputItem]" :placeholder="$t(item.placeholder[inputIndex])"
								:value="item.value[inputIndex] ? item.value[inputIndex] : ''" disabled />
							</block>
							<block v-if="isDetail2==0">
								<u-input v-for="(inputItem, inputIndex) in item.key" type="digit" :key="inputIndex"
								v-model="formData[inputItem]" :placeholder="$t(item.placeholder[inputIndex])"
								:value="item.value[inputIndex] ? item.value[inputIndex] : ''" />
							</block>
						</view>
					</u-form-item>
				</template>


				<!--TODO::时间选择-->
				<template v-if="item.type === 'picker'">
					<formPicker :item="item" @change="selPicker" />
				</template>

				<!--TODO::select选择-->
				<template v-if="item.type === 'select'">
					<formSelect :item="item" @change="selectChange" />
				</template>

				<!--rating - 评分（仅展示）-->
				<template v-if="item.type === 'rating'">
					<u-form-item :key="index" :label="$t(item.label)" :label-style="labelStyle"
						:required="item.required">
						<user-rating :num="item.value" cusStyle="justify-content:flex-start;" />
					</u-form-item>
				</template>


				<!--商品类型（可切换）-->
				<template v-if="item.type === 'goods_type'">
					 
					<view>{{ $t('请选择货物类型')}}</view>
					<view class="nav_z" :class="lang !='zh'?'nav_ru':''">
						<block v-if="lang !='zh'">
							<view class="tabnav_ru" :class="item.value==1||classCurrent==1?'tab_nav_on':''" @click="change(1);item.value=1">{{$t('中国货物')}}</view>
							<view class="tabnav_ru" :class="item.value==2||classCurrent==2?'tab_nav_on':''" @click="change(2);item.value=2">{{$t('俄罗斯货物')}}</view>
							<view class="tabnav_ru" :class="item.value==4||classCurrent==4?'tab_nav_on':''" @click="change(4);item.value=4">{{$t('在中俄货')}}</view>
							<view class="tabnav_ru" :class="item.value==3||classCurrent==3?'tab_nav_on':''" @click="change(3);item.value=3">{{$t('在俄中货')}}</view>
						</block>
						<block v-if="lang ==='zh'">
							<view class="tab_nav" :class="item.value==1||classCurrent==1?'tab_nav_on':''" @click="change(1);item.value=1">{{$t('中国货物')}}</view>
							<view class="tab_nav" :class="item.value==2||classCurrent==2?'tab_nav_on':''" @click="change(2);item.value=2">{{$t('俄罗斯货物')}}</view>
							<view class="tab_nav" :class="item.value==4||classCurrent==4?'tab_nav_on':''" @click="change(4);item.value=4">{{$t('在中俄货')}}</view>
							<view class="tab_nav" :class="item.value==3||classCurrent==3?'tab_nav_on':''" @click="change(3);item.value=3">{{$t('在俄中货')}}</view>
						</block>
					</view>
				</template>

				<!--商品自定义参数-->
				<template v-if="item.type === 'parameter'">
					
					<goodsParameter :isDetail2="isDetail2" @change="selParameter" :value="value"></goodsParameter>

				</template>



			</template>
		</u-form>
		
		<u-popup v-model="show" style="z-index: 10000;">
			<view style="width: 90%;margin-left:5%; margin-top: 60rpx; line-height: 36rpx; text-align: center; font-size: 32rpx;font-weight: bold;">{{ $t(explainTitle)||'' }}</view>
			<view style="width: 90%;margin-left:5%; margin-top: 20rpx; line-height: 36rpx; text-align: center; font-size: 28rpx;">{{ $t(explain)||'' }}</view>
			<button @click="guanbi" style="margin-top: 50rpx;width: 80%;">
				{{$t('关闭')}}
			</button>
		</u-popup>
		
		
	</view>
</template>

<script>
	/**
	 * 表单构建组件
	 * @author zhp
	 * @params name string 表单名
	 * @params label string 文字提示
	 * @params type string 表单类型 input,select,radio,images,files,city,goods_type_select,actionSheet,digit
	 * @params required bool 是否必填，默认true，此处只用户判断是否显示 *
	 * @params rules {} 校验规则
	 * @params details [] 详情数据，select,radio等类型使用
	 */
	import actionSheet from "@/components/buildForm/actionSheet.vue";	
	import formRadio from "@/components/buildForm/formRadio.vue";
	import formImages from "@/components/buildForm/formImages.vue";
	import formFiles from "@/components/buildForm/formFiles.vue";
	import formVideos from "@/components/buildForm/formVideos.vue";
	import formCity from "@/components/buildForm/formCity.vue";
	import formCity2 from "@/components/buildForm/formCity2.vue";	
	import formPortCity from "@/components/buildForm/formPortCity.vue";
	import formPicker from "@/components/buildForm/formPicker.vue";
	import formSelect from "@/components/buildForm/formSelect.vue";
	import formCheckBox from "@/components/buildForm/formCheckBox.vue";
	import UserRating from "@/components/userRating.vue";
	import goodsParameter from "@/components/buildForm/goods_parameter.vue";

	export default {
		components: {
			UserRating,
			goodsParameter,
			actionSheet,
			formRadio,
			formImages,
			formFiles,
			formCity,
			formCity2,
			formPicker,
			formSelect,
			formCheckBox,
			formPortCity,
			formVideos
		},
		props: {
			formItems: {
				type: Array,
				default: [],
				required: true
			},
			select_city_new:{
				type: [Array,Object,null],
				required: false,
				default() {
				  return [
					// 初始化对象的属性，确保是有效的默认值
				  ];
				}
			},
			select_city_newd:{
				type: [Array,Object,null],
				required: false,
				default() {
				  return [
					// 初始化对象的属性，确保是有效的默认值
				  ];
				}
			},
			isDetail2:{
				type: [Number,null],
				default: 0,
				required: false
			},
			// 表单数据
			value: {
				type: [Array,Object],
				required: true
			},
			marginTop: {
				type: [String,null],
				default:'0rpx'
			},
			bg:{
				type: [String,null],
				default:'1'
			},
			radius_:{
				type: [String,null],
				default:'0'
			},
			postunit:{
				type: [Array,Object,Number,String],
				default:''
			},
			hwjbfb:{
				type: [Array,Object,Number,String],
				default:'0'
			},
		},
		data() {
			return {
				classCurrent: "0",	//货物所在地 选中的分类id
				class_bg:"white",	//背景颜色
				
				errorMessage: '',
				sel_list1:[],
				sel_list2:[],
				show:false,
				explainTitle:'',
				explain:'',
				
				is_margin_show:1,
				is_express_price:1,
				
				
				labelStyle: {
					'word-break': 'break-all',
				},
				lang: getApp().globalData.lang,
				formData: {},
				placeholderStyle: "text-align: left;",
				textareaStyle: {
					// padding: "20rpx",
					height: "400rpx"
				},
				textareaStyle2: {
					padding: "20rpx",
					height: "60rpx",
					minHeight:"60rpx",
					border:"1px solid #eee"
				},
				borderTopRightRadius:'0rpx',
				borderTopLeftRadius:'0rpx',
				borderBottomRightRadius:'0rpx',
				borderBottomLeftRadius:'0rpx',
				// rules: {
				//     name: {
				//         required: true,
				//         message: '请输入名称',
				//         trigger: ['change','blur']
				//     }
				// }
			}
		},
		mounted() {
			
			this.formData = this.value
			console.log(this.formData)
			console.log(this.formItems)
			
			if(this.radius_=='0'){			
			}else if(this.radius_=='1'){
				this.borderTopLeftRadius = "20rpx"
				this.borderTopRightRadius = "20rpx"
			}else if(this.radius_=='2'){
				this.borderBottomLeftRadius = "20rpx"
				this.borderBottomRightRadius = "20rpx"
			}else if(this.radius_=='3'){
				this.borderTopLeftRadius = "20rpx"
				this.borderTopRightRadius = "20rpx"
				this.borderBottomLeftRadius = "20rpx"
				this.borderBottomRightRadius = "20rpx"
			}
			
			if(this.bg==1){
				if(this.formItems.length==0){
					this.class_bg = 'white '
				}else{
					this.class_bg = 'white'
				}
			}else{
				if(this.formItems.length==0){
					this.class_bg = 'yellow '
				}else{
					this.class_bg = 'yellow'
				}
			}
			
		},
		watch: {
			formData: {
				handler(val) {
					this.$emit('input', val)
				},
				deep: true,
			},
			formItems: {
				handler(val) {
					this.formItems = val
				},
			}
		},
		methods: {
			checkAmount(event) {
			  const value = event;
			  const regex = /(^[1-9]\d*(\.\d{1,2})?$)|(^0(\.\d{1,2})?$)/; // 正则表达式，匹配最多有两位小数的金额数字
			  if (!regex.test(value)) {
				this.$u.toast(this.$t('请输入正确的金额格式!'));
			  }
			},
			selActionSheet(key, value,list) {  
				console.log({'key':key,'value':value,'list':list})
				this.formData[key] = value
				this.sel_list1 = list	
				if(key=='departure_country'){
					this.formData['departure_city'] = ''
					uni.showLoading({
						mask:true
					})
					setTimeout(function(){
						uni.hideLoading()
					},1000)
				}
				if(key=='reach_country'){
					this.formData['reach_city'] = ''
					uni.showLoading({
						mask:true
					})
					setTimeout(function(){
						uni.hideLoading()
					},1000)
				}
				this.$emit('changeActionSheet', value,this.sel_list1,key)
				
			},
			selActionSheet2(key, value,list) {
				console.log({'key':key,'value':value,'list':list})
				this.formData[key] = value
				this.sel_list2 = list
				if(key=='departure_country'){
					this.formData['departure_city'] = ''
					uni.showLoading({
						mask:true
					})
					setTimeout(function(){
						uni.hideLoading()
					},1000)
				}
				if(key=='reach_country'){
					this.formData['reach_city'] = ''
					uni.showLoading({
						mask:true
					})
					setTimeout(function(){
						uni.hideLoading()
					},1000)
				}
				this.$emit('changeActionSheet2', value,this.sel_list2,key)
			},
			guanbi(){
				this.show=false
			},
			selCheckbox(key, value) {
				this.formData[key] = value
			},
			selRadio(key, value) {		
				console.log(key)
				if(key=='is_margin'){
					if(value=='1'){
						this.is_margin_show=1
					}else{
						this.is_margin_show=2
					}
				}	
					
				if(key=='is_express_price'){
					if(value=='1'){
						this.is_express_price=1
					}else{
						this.is_express_price=2
					}
				}
				
				this.formData[key] = value			
			},
			selRadio1(key, value) {
				if(key=='is_margin'){
					if(value=='1'){
						this.is_margin_show=1
					}else{
						this.is_margin_show=2
					}
				}	
					
				if(key=='is_express_price'){
					if(value=='1'){
						this.is_express_price=1
					}else{
						this.is_express_price=2
					}
				}
				this.formData[key] = value	
				console.log(this.formData)
			},
			selImages(key, value) {
				this.formData[key] = value
			},
			selFiles(key, value) {
				this.formData[key] = value
			},
			selFiles2(key, value) {
				this.formData[key] = value
			},
			selVideos(key, value) {
				this.formData[key] = value
			},
			selCity(key, value) {
				this.formData[key] = value
			},
			selPicker(key, value) {
				this.formData[key] = value
			},
			selectChange(key, value) {
				this.formData[key] = value
			},
			clickIcon(item) {
				if (item.explain) {
					let me = this;
					// uni.showModal({
					// 	title: me.$t(item.explainTitle),
					// 	content: me.$t(item.explain),
					// 	showCancel: false,
					// 	confirmText: "ok"
					// })
					
					me.explainTitle = item.explainTitle
					me.explain = item.explain
					
					me.show=true
				}
			},			
			//切换货物所在地 分类id
			change(id) {
				this.classCurrent = id
				this.formData['goods_type'] = id
			},
			selParameter(e){
				this.formData.parameter = e.parameter
			}
		}
	}
</script>

<style lang="scss">
	.white{
		background-color: #ffffff;
	}
	.yellow{
		background-color: #fefcf6;
	}
	.padding0{padding: 0rpx !important;}
	.nav_z{width: 100%;height:50rpx; margin-top:20rpx ;  display: flex;}
	.nav_ru{ height: 70rpx !important; }
	.tab_nav{ width: 22%;margin-left: 2%; line-height: 50rpx;text-align: center;border-radius: 10rpx;   color: #606266;font-size: 24rpx ;background-color: rgb(237, 237, 237);}
	.tabnav_ru{width: 22%;margin-left: 2%;line-height: 35rpx; text-align: center;border-radius: 10rpx;   color: #606266;font-size: 18rpx ;background-color: rgb(237, 237, 237);}
	.tab_nav_on{ color: #fff !important;background-image: linear-gradient(to right, #ffd234, #ff884d) !important;}	
</style>